<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
    <script src="./vue.js"></script>
    <script>
      /*
      v-指令名称:参数="表达式"
      */
      const vm = new Vue({
        el: "#app",
        template: `
        <div>
          <input v-bind:value="username">
          <hr>
          <p v-if="flag">hello jack</p>
          <hr>
          <button v-on:click="say()">click</button>
          <hr>
          <button v-on:[ename]="say()">click</button>
        </div>
        `,
        data: {
          username: "jack",
          flag: true,
          ename: 'cli'+'ck',
        },
        methods: {
          say() {
            console.log("hello jack");
            return this.username;
          },
        },
      });

      vm.age = 20;
    </script>
  </body>
</html>
